#include "optDevice.h"
#include "my_link.h"
int cmp(const void *dast, const void *str)
{
    data_type dast_t = *(data_type *)dast;
    data_type str_t = *(data_type *)str;

    if (dast_t.id[0] == str_t.id[0])
        return 0;

    return 1;
}

int optDevice(int deviceId)
{
    data_type tmp = {0};
    tmp.id[0] = deviceId;

    // data_type *p = link_find(H, &tmp, cmp);

    // return p->id[1];

    return link_find(H, &tmp, cmp)->id[1];
}
